package cn.roadtrip.utilmodule.util.enumpck;

/**
 * 商户类型
 */
public enum Enum_ShopType {
    // 产品商家（需要绑定核销员，核销），产品由后台上传；   旅游公司；汽车公司；景点；酒店宾馆
    Normal("Normal", "普通商户"),
    Trip("Trip", "旅游公司"),
    Auto("Auto", "汽车公司"),
    Sight("Sight", "景区"),
    Hotel("Hotel", "酒店");
    private String s;
    private String title;

    Enum_ShopType(String s, String title) {
        this.s = s;
        this.title = title;
    }
    Enum_ShopType(String s) {
        this.s = s;
        this.title = Enum_ShopType.parseCode(s).getTitle();
    }

    public String getTitle() {
        return this.title;
    }

    public String getCode() {
        return this.s;
    }


    public static final Enum_ShopType parseCode(String code) {
        switch (code) {
            case "Normal":
                return Normal;
            case "Trip":
                return Trip;
            case "Auto":
                return Auto;
            case "Sight":
                return Sight;
            case "Hotel":
                return Hotel;
        }
        return null;
    }

    @Override
    public String toString() {
        return "(code:%s, title:%s)".formatted(this.s, this.title);
    }

}
